clear all
set more off
set mem 100m

********************************************
***** education, age, marriage returns *****
********************************************

***** merge returns *****

use mex_pwages_urban_state
sort educ_cat age_cat married
merge educ_cat age_cat married using us_pwages
rename _merge merge_us
drop merge*
sort educ_cat age_cat married


***** generate differential returns *****

gen diff_earnings=return_incwage_us- return_incwage_state_urban
gen lvl_earnings=level_incwage_us- level_incwage_state_urban

keep educ_cat age_cat married state urban diff* lvl*

rename educ_cat yearsch_cat5
rename age_cat age_cat5

sort yearsch_cat5 age_cat5 married state urban
save returns_mexico_us, replace


